<!DOCTYPE html>
<html xmlns="">
<head>
    <meta charset="UTF-8">
    <title>${serverName}-修改用户信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${hostUrl}/static/layui/css/layui.css">
    <script type="text/javascript" src="${hostUrl}/static/layui/layui.js"></script>
    <script>
        layui.use('form', function(){
            var form = layui.form;
            //监听提交
            form.on('submit(formDemo)', function(data){
                var $ = layui.$;
                $.ajax({
                    type: 'post',
                    data: $('#userForm').serialize(),
                    url: '${hostUrl}/user/update',
                    cache:false,
                    dataType:'json',
                    success: function (resp) {
                        layer.msg(resp.msg);
                    }
                })
                // 返回false，则不跳转页面
                return false;
            });
        });
    </script>
</head>
<body >
    <!-- 强行添加两行，避免Form太过靠上了 -->
    <br/><br/>

    <form class="layui-form" id="userForm">
        <input type="hidden" name="userId" value="${loginUser.userId}">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline ">
                <input type="text" name="userName" required  class="layui-input layui-disabled" value="${loginUser.userName}" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">用户昵称</label>
            <div class="layui-input-inline">
                <input type="text" name="nickname"  placeholder="请输入用户昵称" autocomplete="off" class="layui-input" value="${loginUser.nickname}" required lay-verify="required">
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea name="remarks" placeholder="请输入备注，此项可以为空" class="layui-textarea">${loginUser.remarks!}</textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">确定修改</button>
            </div>
        </div>
    </form>
</body>
</html>